<template>
  <div class="outer">
    <h1>我是count</h1>
    <p>电影的数量：{{count}}  &nbsp;&nbsp;&nbsp;&nbsp;  电影的单价：{{price}}</p>
    <p>电影总价钱是：{{allPrice}}</p>
    <button @click="increatment">添加电影</button>
  </div>
</template>

<script>
import {mapMutations, mapState } from 'vuex';
export default {
    name:'Count',
    computed:{
        price(){
            return this.$store.state.price
        },
        ...mapState(['count','allPrice'])
    },
    methods:{
        ...mapMutations(['increatment'])
    },
    
}
</script>

<style scoped>
    .outer{
        text-align: center;
        background-color: aqua;
    }
</style>